package com.truthbean.jeetb.utils.web.invoker;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.PrintWriter;

/**
 * Created by truth on 16-12-1.
 */
public class BeforeInvoker extends DefaultInvoker {
    public void invoke(HttpServletRequest request, HttpServletResponse response, HttpSession session) throws Exception {
        try {
            PrintWriter out = response.getWriter();
            String result = "<html>" +
                    "<head>" +
                    "<title>This a test page</title>" +
                    "<style type=\"text/css\">" +
                    "body,td{font: 12px Arial,Tahoma;line-height: 16px;}" +
                    ".input{font:12px Arial,Tahoma;background:#fff;border: 1px solid #666;padding:2px;height:22px;}" +
                    ".area{font:12px 'Courier New', Monospace;background:#fff;border: 1px solid #666;padding:2px;}" +
                    ".bt {border-color:#b0b0b0;background:#3d3d3d;color:#ffffff;font:12px Arial,Tahoma;height:22px;}" +
                    "a {color: #00f;text-decoration:underline;}" +
                    "a:hover{color: #f00;text-decoration:none;}" +
                    ".alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f1f1f1;padding:5px 10px 5px 5px;}" +
                    ".alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f9f9f9;padding:5px 10px 5px 5px;}" +
                    ".focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ffffaa;padding:5px 10px 5px 5px;}" +
                    ".head td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#e9e9e9;padding:5px 10px 5px 5px;font-weight:bold;}" +
                    ".head td span{font-weight:normal;}" +
                    "form{margin:0;padding:0;}" +
                    "h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}" +
                    "ul.info li{margin:0;color:#444;line-height:24px;height:24px;}" +
                    "u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}" +
                    ".secho{height:400px;width:100%;overflow:auto;border:none}" +
                    "</style>" +
                    "</head>" +
                    "<body style=\"margin:0;table-layout:fixed; word-break:break-all\">";
            out.println();
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
}
